/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mycompany.CaveStubGenerator;

/**
 *
 * @author JHS-Home
 */
public class TypeNum {

    public final static char CHAR = 1;
    public final static char SHORT = 2;
    public final static char INT = 3;
    public final static char LONG = 4;
    public final static char LONGLONG = 5;
    public final static char UCHAR = 6;
    public final static char USHORT = 7;
    public final static char UINT = 8;
    public final static char ULONG = 9;
    public final static char ULONGLONG = 10;
    public final static char FLOAT = 11;
    public final static char DOUBLE = 12;
    public final static char LONGDOUBLE = 13;
    public final static char BOOL = 14;

    public static String getTypeName(int type) {
        String arrTypePart = "";
        if (type >= 32) {
            type -= 32;
            arrTypePart = "[]";
        }
        String basetype = "";
        switch (type) {
            case 1:
                basetype = "char";
                break;
            case 2:
                basetype = "short";
                break;
            case 3:
                basetype = "int";
                break;
            case 4:
                basetype = "long";
                break;
            case 5:
                basetype = "long";
                break;
            case 6:
                basetype = "char";
                break;
            case 7:
                basetype = "short";
                break;
            case 8:
                basetype = "int";
                break;
            case 9:
                basetype = "long";
                break;
            case 10:
                basetype = "long";
                break;
            case 11:
                basetype = "float";
                break;
            case 12:
                basetype = "double";
                break;
            case 13:
                basetype = "double";
                break;
            case 14:
                basetype = "boolean";
                break;
            default:
                System.out.println("Type Error ");
                return "Error";
        }
        return basetype + " " + arrTypePart;
    }

    public static String getTypeVectorName(int type) {
        String typeVectorName = "cfh.";
        switch (type) {
            case 1:
                typeVectorName += "vc";
                break;
            case 2:
                typeVectorName += "vs";
                break;
            case 3:
                typeVectorName += "vi";
                break;
            case 4:
                typeVectorName += "vl";
                break;
            case 5:
                typeVectorName += "vl";
                break;
            case 6:
                typeVectorName += "vc";
                break;
            case 7:
                typeVectorName += "vs";
                break;
            case 8:
                typeVectorName += "vi";
                break;
            case 9:
                typeVectorName += "vl";
                break;
            case 10:
                typeVectorName += "vl";
                break;
            case 11:
                typeVectorName += "vf";
                break;
            case 12:
                typeVectorName += "vd";
                break;
            case 13:
                typeVectorName += "vd";
                break;
            case 14:
                typeVectorName += "vb";
                break;
            case 1+32:
                typeVectorName += "vcr";
                break;
            case 2+32:
                typeVectorName += "vsr";
                break;
            case 3+32:
                typeVectorName += "vir";
                break;
            case 4+32:
                typeVectorName += "vlr";
                break;
            case 5+32:
                typeVectorName += "vlr";
                break;
            case 6+32:
                typeVectorName += "vcr";
                break;
            case 7+32:
                typeVectorName += "vsr";
                break;
            case 8+32:
                typeVectorName += "vir";
                break;
            case 9+32:
                typeVectorName += "vlr";
                break;
            case 10+32:
                typeVectorName += "vlr";
                break;
            case 11+32:
                typeVectorName += "vfr";
                break;
            case 12+32:
                typeVectorName += "vdr";
                break;
            case 13+32:
                typeVectorName += "vdr";
                break;
            case 14+32:
                typeVectorName += "vbr";
                break;
            default:
                System.out.println("Type Error ");
                return "Error";
        }
        return typeVectorName + ".remove(0);";
    }
}
